Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Conversation

theRoughCode
Copy link
Contributor

@theRoughCode theRoughCode commented Aug 6, 2020

This PR is a first step at implementing classical operations as part of the goal of visualizing Q# programs (more details here).

In this PR, we:

  1. Create a new IsConditional flag that is true if the operation is a conditional operation.
  2. Create a new ResultMeasured class derived from the Result class that contains the measured qubit.
  3. Implements the GetRuntimeMetadata methods for ApplyIfElseR, ApplyIfElseRC, ApplyIfElseRA, and ApplyIfElseRCA.

Once end-to-end testing of this flow (classically-controlled operations) works, we can duplicate this functionality for other operations such as ApplyIfOne and ApplyIfZero.

NOTE: This should be merged in after #324 as this is branched off of that PR.

@theRoughCode theRoughCode requested review from cgranade and anpaz August 6, 2020 19:14
@theRoughCode theRoughCode self-assigned this Aug 6, 2020
@theRoughCode theRoughCode marked this pull request as draft August 7, 2020 15:20
@theRoughCode theRoughCode marked this pull request as ready for review August 10, 2020 18:50
@theRoughCode theRoughCode changed the base branch from master to raphael/dedup August 10, 2020 18:52
Base automatically changed from raphael/dedup to master August 10, 2020 22:16
/// <summary>
/// True if operation is a classically-controlled conditional operation.
/// </summary>
public bool IsConditional { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I like this name/description for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the name not descriptive enough or is it the description that is not clear?
This flag is true when the operation is an If-Else statement, like ApplyIfElseR and will contain 2 Children (one for each measurement value).

@theRoughCode theRoughCode marked this pull request as draft August 21, 2020 20:26
@bettinaheim
Copy link
Contributor

@anpaz-msft Is this piece still needed? I thought we had merged everything related to visualization.

@microsoft-github-updates microsoft-github-updates bot changed the base branch from master to main September 9, 2020 07:52
@bettinaheim
Copy link
Contributor

Closing this PR since I believe this is no longer needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants